package interpreterPattern;

import java.util.HashMap;
import java.util.Map;

//上下文信息
public class Context {

    private Map<String, Integer> map;

    public Context() {
        map = new HashMap<String, Integer>();
    }

    public void addVariable(String variable, int value) {
        map.put(variable, value);
    }

    public int getValue(String variable) {
        return map.get(variable);
    }
}
